<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style>
*{
      margin: 0;
      padding: 0;
    }
    .scroll{
      margin:100px;
      width: 500px;
      height: 5px;
      background: #ccc;
      position: relative;
    }
    .bar{
      width: 10px;
      height: 20px;
      background: #369;
      position: absolute;
      top: -7px;
      left: 0;
      cursor: pointer;
    }
    .mask{
      position: absolute;
      left: 0;
      top: 0;
      background: #369;
      width: 0;
      height: 5px;
    }
    #hu{
      display: none;
    }
    #pro{
    display: none;
    }
</style>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- bootstrap-css -->
<link rel="stylesheet" href="css/bootstrap.min.css" >
<!-- //bootstrap-css -->
<!-- Custom CSS -->
<link href="css/style.css" rel='stylesheet' type='text/css' />
<link href="css/style-responsive.css" rel="stylesheet"/>
<!-- font-awesome icons -->
<link rel="stylesheet" href="css/font.css" type="text/css"/>
<link href="css/font-awesome.css" rel="stylesheet"> 
</head>
<body>

<section id="container">
<!--header start-->
<header class="header fixed-top clearfix">
<!--logo start-->
<div class="brand">

    <a href="index.html" class="logo">
       卓越项目员工系统
    </a>
    <div class="sidebar-toggle-box">
        <div class="fa fa-bars"></div>
    </div>
</div>
<!--logo end-->

<div class="nav notify-row" id="top_menu">
    <!--  notification start -->
    
    <!--  notification end -->
</div>
<div class="top-nav clearfix">
    <!--search & user info start-->
    <ul class="nav pull-right top-menu">
       
        <!-- user login dropdown start-->
        <li class="dropdown">
            <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                <img alt="" src="images/2.png">
                <span class="username"><%= session.getAttribute("b") %></span>
                <b class="caret"></b>
            </a>
            <ul class="dropdown-menu extended logout">
                <li><a href="login.jsp"><i class="fa fa-key"></i>退出登录</a></li>
            </ul>
        </li>
        <!-- user login dropdown end -->
       
    </ul>
    <!--search & user info end-->
</div>
</header>
<!--header end-->
<!--sidebar start-->
<aside>
    <div id="sidebar" class="nav-collapse">
        <!-- sidebar menu start-->
        <div class="leftside-navigation">
                      </div>
        <!-- sidebar menu end-->
    </div>
</aside>
<!--sidebar end-->
<!--main content start-->
<section id="main-content">
	<section class="wrapper">
		<div class="table-agile-info">
 <div class="panel panel-default">
    <div class="panel-heading">
       我的任务
    </div>
    <div>
      <table class="table" id="ta" ui-jq="footable" ui-options='{
        "paging": {
          "enabled": true
        },
        "filtering": {
          "enabled": true
        },
        "sorting": {
          "enabled": true
        }}'>
       
        
      </table>
    </div>
  </div>
  
  
  <div class="panel panel-default">
     <div class="panel-heading">
        我的项目
     </div>
     <div>
       <table class="table" id="to" ui-jq="footable" ui-options='{
         "paging": {
           "enabled": true
         },
         "filtering": {
           "enabled": true
         },
         "sorting": {
           "enabled": true
         }}'>
        
         
       </table>
     </div>
   </div>
</div>
</section>
		
 <!-- footer -->
		  <div class="footer">
			<div class="wthree-copyright">
			  <span>本网站最终解释权归XX公司所有<a target="_blank" href="http://www.17sucai.com/"></a></span>
			</div>
		  </div>
  <!-- / footer -->
</section>

<!--main content end-->
</section>


<div class="container">
 
  
  
   
  <!-- 模态框 -->
  <div class="modal fade" id="dal">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
   
        <!-- 模态框头部 -->
        <div class="modal-header">
          <h4 class="modal-title">详情</h4>
          <button type="button" class="close" data-dismiss="modal">&times;</button>
        </div>
   
        <!-- 模态框主体 -->
        <div class="modal-body">
          <span>任务标题</span>
          <div class="card bg-dark text-white">
                   <div class="card-body" id="title"></div>
           </div><br>
         <span>计划开始时间</span>
          <div class="card bg-dark text-white">
                   <div class="card-body" id="ktime"></div>
           </div><br>
           <span>执行人</span>
          <div class="card bg-dark text-white">
                   <div class="card-body" id="man"></div>
           </div><br>
           <span>任务说明</span>
          <div class="card bg-dark text-white">
                   <div class="card-body" id="shuo"></div>
           </div><br>
           <span>工期</span>
          <div class="card bg-dark text-white">
                   <div class="card-body" id="gong"></div>
           </div><br>
           <span>计划结束时间</span>
          <div class="card bg-dark text-white">
                   <div class="card-body" id="endtime"></div>
           </div><br>
           <span>优先级</span>
          <div class="card bg-dark text-white">
                   <div class="card-body" id="you"></div>
           </div><br>
 
        </div>
   
        <!-- 模态框底部 -->
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
        </div>
   
      </div>
    </div>
  </div>
  
</div>

<div class="container">
  
 
   
  <!-- 模态框 -->
  <div class="modal fade" id="myModal">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
   
        <!-- 模态框头部 -->
        <div class="modal-header">
          <h4 class="modal-title">负责模块</h4>
          <button type="button" class="close" data-dismiss="modal">&times;</button>
        </div>
   
        <!-- 模态框主体 -->
        <div class="modal-body">
      <span id="hu"></span>
        <h4 id="pro"></h4>
        <h4 id="mo"></h4>
        <!-- 拖动条 -->
          <div class="progress">
    <div class="progress-bar" id="pp" style="width:0%"></div>
     </div>
     <div class="btn-group">
    <button type="button" class="btn btn-primary" onclick="jian()"><</button>
    
    <button type="button" class="btn btn-primary" onclick="jia()">></button>
  </div>
        </div>
   
        <!-- 模态框底部 -->
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
          <button type="button" class="btn btn-outline-dark" onclick="up()">提交</button>
           <button type="button" class="btn btn-outline-dark"  data-toggle="modal" data-dismiss="modal" data-target="#abc" >提交BUG</button>
        </div>
   
      </div>
    </div>
  </div>
  
</div>



<div class="container">
 
  
  
   
  <!-- 模态框 -->
  <div class="modal fade" id="abc">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
   
        <!-- 模态框头部 -->
        <div class="modal-header">
          <h4 class="modal-title">BUG提交</h4>
          <button type="button" class="close" data-dismiss="modal">&times;</button>
        </div>
   
        <!-- 模态框主体 -->
        <div class="modal-body">
         
           <div class="input-group mb-3">
      <div class="input-group-prepend">
        <span class="input-group-text">bug主题</span>
      </div>
      <input type="text" class="form-control" id="zhu" placeholder="First Name">
     
    </div> 
    <div class="input-group mb-3">
     <div class="input-group-prepend">
        <span class="input-group-text">平台</span>
      </div>
       <select id="op">
      <option>Android</option>
      <option>iOS</option>
      <option>H5</option>
      <option>Web</option>
      <option>PC</option>
      </select>
     
   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     <div class="input-group-prepend">
        <span class="input-group-text">bug类型</span>
      </div>
      <select id="oo">
      <option>业务逻辑</option>
      <option>功能操作</option>
      <option>功能优化</option>
      <option>交互逻辑</option>
      <option>数据问题</option>
      <option>条件限制问题</option>
      <option>界面优化</option>
      <option>兼容性问题</option>
      <option>性能优化</option>
      <option>安全问题</option>

      </select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <div class="input-group-prepend">
        <span class="input-group-text">严重级别</span>
      </div>
      <select id="sc">
      <option>严重</option>
      <option>普通</option>
      <option>低级</option>
      </select>
    </div>   
    <div class="input-group mb-3">
     <div class="input-group-prepend">
        <span class="input-group-text">bug测试机型</span>
      </div>
      <select id="so">
      <option>IE</option>
      <option>chrome</option>
      <option>firefox</option>
      <option>opera</option>
      <option>safari</option>
      <option>IPhoneX</option>
      <option>IPhone8/Plus</option>
      <option>IPhone7/Plus</option>
      <option>Android7.0</option>
      <option>Android8.0</option>

      </select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <div class="input-group-prepend">
        <span class="input-group-text">分工</span>
      </div>
      <select id="sd">
      <option>前端</option>
      <option>后端</option>
      
      </select>
    </div> 
        </div>
   
        <!-- 模态框底部 -->
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
            <button type="button" class="btn btn-outline-primary" onclick="ti()">提交</button>
        </div>
   
      </div>
    </div>
  </div>
  
</div>

<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/bootstrap.min.js"></script>

<script src="js/jquery.dcjqaccordion.2.7.js"></script>
<script src="js/scripts.js"></script>
<script src="js/jquery.slimscroll.js"></script>
<script src="js/jquery.nicescroll.js"></script>
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="js/flot-chart/excanvas.min.js"></script><![endif]-->
<script src="js/jquery.scrollTo.js"></script>
<script>
pcha();
prAll();
function pcha(){
	var pName=$(".username").text();
	console.log(pName)
	$.ajax({
		type:"post",
		url:"pName",
		data:{pName},
		success:function(data){
			console.log(data);
			if(data==null){
				
				alert("没有找到");
				//刷新表格
				
			}else{
				var tableStr = "";
				 
				 for (var i = 0; i < data.length; i++) {
					tableStr += "<tr><td><input type='checkbox' value='"+data[i].t_id+"' /></td>";
					tableStr += "<td>"+data[i].t_id+"</td>";
					tableStr += "<td>"+data[i].t_tiele+"</td>";
					tableStr += "<td>"+data[i].t_time+"</td>";
					tableStr += "<td>"+data[i].uname+"</td>";
					tableStr += "<td>"+data[i].p_name+"</td>";
					tableStr += "<td>"+data[i].t_priority+"</td>";
					tableStr += "<td><button type='button' class='btn btn-info' data-toggle='modal' data-target='#dal' onClick='dan("+data[i].t_id+")'>查看</button></td>";
				
				}
				 var tht="<tr><th style='width:20px;'><label class='i-checks m-b-none'><input type='checkbox'><i></i></label></th><th>编号</th><th>任务标题</th><th>创建时间</th><th>发送者</th><th>执行人</th><th>优先级</th><th>操作</th></tr>";
				$("#ta").empty().append(tht).append(tableStr); 
			}
		}
	})
	
}
function dan(tId){
	
	$.ajax({
		type:"post",
		url:"dan",
		data:{tId},
		success:function(data){
			console.log(data);
			
			
			$("#title").empty().append(data[0].t_tiele);
		    $("#ktime").empty().append(data[0].t_time);
			$("#man").empty().append(data[0].p_name);
			$("#shuo").empty().append(data[0].t_explain);
			$("#gong").empty().append(data[0].t_relationship);
            $("#endtime").empty().append(data[0].t_endtime);
            $("#you").empty().append(data[0].t_priority);
            
		}
	})
	
}

function prAll(){
	$.ajax({
		type:"post",
		url:"pll",
		data:{},
		success:function(data){
			console.log(data);
			var Str = "";
			 
			 for (var i = 0; i < data.length; i++) {
				Str += "<tr><td id='ty'>"+data[i].p_id+"</td>";
				Str += "<td><a href='#' onClick='kehu(this)' data-toggle='modal' data-target='#myModal'>"+data[i].c_name+"</a></td>";
				Str += "<td>"+data[i].p_name+"</td>";
				Str += "<td>"+data[i].uname+"</td>";
				
				Str += "<td>"+data[i].p_number+"</td>";
				Str += "<td>"+data[i].p_price+"</td>";
				Str += "<td>"+data[i].p_priority+"</td>";
				Str += "<td><a href='#' onClick='jindu("+data[i].p_id+")' data-toggle='modal' data-target='#myModal'>"+data[i].p_state+"</a></td>";
				
			
			}
			 var tht="<tr><th>编号</th><th>客户名称</th><th>项目名称</th><th>项目经理</th><th>开发人数</th><th>奖金</th><th>优先级</th><th>情况</th></tr>";
			$("#to").empty().append(tht).append(Str); 
	 
		}
	})
}
function jindu(btn){
	
	$("#pro").text(btn);
	var d=$(".username").text();
	console.log(btn)
	var id=btn
	if(d=="张三"){
        $.ajax({
        	type:"post",
        	url:"one",
        	data:{id},
        	success:function(data){
        		console.log(data);
        	  $("#mo").text(data[0].m_one);
        	  $("#pp").width(data[0].m_progressone);
        	  $("#pp").text(data[0].m_progressone);
        	  $("#hu").text(data[0].m_id);
        	}
        })
         
	}else if(d=="李四"){
		 $.ajax({
	        	type:"post",
	        	url:"tow",
	        	data:{id},
	        	success:function(data){
	        		console.log(data);
	        	  $("#mo").text(data[0].m_tow);
	        	  $("#pp").width(data[0].m_progresstow);
	        	  $("#pp").text(data[0].m_progresstow);
	        	  $("#hu").text(data[0].m_id);
	        	}
	        })
	}else if(d=="王五"){
		 $.ajax({
	        	type:"post",
	        	url:"three",
	        	data:{id},
	        	success:function(data){
	        		console.log(data);
	        	  $("#mo").text(data[0].m_therr);
	        	  $("#pp").width(data[0].m_progressthree);
	        	  $("#pp").text(data[0].m_progressthree);
	        	  $("#hu").text(data[0].m_id);
	        	}
	        })
	}else if(d=="李二"){
		 $.ajax({
	        	type:"post",
	        	url:"four",
	        	data:{id},
	        	success:function(data){
	        		console.log(data);
	        	  $("#mo").text(data[0].m_four);
	        	  $("#pp").width(data[0].m_progressfour);
	        	  $("#pp").text(data[0].m_progressfour);
	        	  $("#hu").text(data[0].m_id);
	        	  
	        	}
	        })
	}else if(d=="麻子"){
		 $.ajax({
	        	type:"post",
	        	url:"five",
	        	data:{id},
	        	success:function(data){
	        		console.log(data);
	        	  $("#mo").text(data[0].m_five);
	        	  $("#pp").width(data[0].m_progressfive);
	        	  $("#pp").text(data[0].m_progressfive);
	        	  $("#hu").text(data[0].m_id);
	        	  
	        	}
	        })
	}
	
	
	
	
}

function jian(){
	snum-=10;
	$("#pp").css("width",snum+"%").text(snum+"%");
	
}
var snum = 0;
function jia(){
	snum+=10;
	$("#pp").css("width",snum+"%").text(snum+"%");
}

function up(){
	var s=$(".username").text();
    if(s=="张三"){
    	var mId=$("#hu").text();
    	var mProgressone=$("#pp").text();
    	var modular={
    			mId:mId,
    			mProgressone:mProgressone
    	}
    	console.log(modular);
    	$.ajax({
    		type:"post",
    		url:"oneup",
    		data:JSON.stringify(modular),
    		contentType:"application/json;charset=utf-8",
    		success:function(data){
    			console.log(data);
    			alert("提交成功")
    		}
    	})
    }else if(s=="李四"){
    	var mId=$("#hu").text();
    	var mProgresstow=$("#pp").text();
    	var modular={
    			mId:mId,
    			mProgresstow:mProgresstow
    	}
    	console.log(modular);
    	$.ajax({
    		type:"post",
    		url:"towup",
    		data:JSON.stringify(modular),
    		contentType:"application/json;charset=utf-8",
    		success:function(data){
    			console.log(data);
    			alert("提交成功")
    		}
    	})
    }else if(s=="王五"){
    	var mId=$("#hu").text();
    	var mProgresstow=$("#pp").text();
    	var modular={
    			mId:mId,
    			mProgressthree:mProgresstow
    	}
    	console.log(modular);
    	$.ajax({
    		type:"post",
    		url:"threeup",
    		data:JSON.stringify(modular),
    		contentType:"application/json;charset=utf-8",
    		success:function(data){
    			console.log(data);
    			alert("提交成功")
    		}
    	})
    }else if(s=="李二"){
    	var mId=$("#hu").text();
    	var mProgresstow=$("#pp").text();
    	var modular={
    			mId:mId,
    			mProgressfour:mProgresstow
    	}
    	console.log(modular);
    	$.ajax({
    		type:"post",
    		url:"fourup",
    		data:JSON.stringify(modular),
    		contentType:"application/json;charset=utf-8",
    		success:function(data){
    			console.log(data);
    			alert("提交成功")
    		}
    	})
    }else if(s=="麻子"){
    	var mId=$("#hu").text();
    	var mProgresstow=$("#pp").text();
    	var modular={
    			mId:mId,
    			mProgressfive:mProgresstow
    	}
    	console.log(modular);
    	$.ajax({
    		type:"post",
    		url:"fiveup",
    		data:JSON.stringify(modular),
    		contentType:"application/json;charset=utf-8",
    		success:function(data){
    			console.log(data);
    			alert("提交成功")
    			
    		}
    	})
    }
}
function ti(){
	var g=$(".username").text();
	var s=$("#pro").text();
	var h=$("#mo").text();
	var z=$("#zhu").val();
	var a=$("#op").find("option:selected").text();
	var b=$("#oo").find("option:selected").text();
	var c=$("#sc").find("option:selected").text();
	var d=$("#so").find("option:selected").text();
	var e=$("#sd").find("option:selected").text();
	
	var dbug={
			 dMan:g,
		     dTheme:z,
		     dPlatform:a,
		     dType:b,
		     bPro:s,
		     bMod:h,
		     bLevel:c,
		     bTm:d,
		     bLabor:e
		}
	
	$.ajax({
		type:"post",
		url:"ad",
		data:JSON.stringify(dbug),
		contentType:"application/json;charset=utf-8",
		success:function(data){
			if(data.status=="success"){
				alert("提交成功");
				$("#abc").modal("show");
				
			}else{
				alert("提交失败");
			}
		}
		
	})
}


</script>
</body>
</html>